package cuiyt.designpattern.proxy.dynamic.cglib;

/**
 * @author cyt
 * @create 2020-07-20 15:29
 */
public class Test {
    public static void main(String[] args) {
        // 创建目标对象
        TeacherDao target = new TeacherDao();
        // 得到代理对象， 目标对象的子类
        TeacherDao proxy = (TeacherDao) new ProxyFactory(target).getProxy();
        String speak = proxy.speak();
        System.out.println("res = > " + speak);
        String teacher = proxy.teacher();
        System.out.println("res = > " + teacher);

    }
}
